package com.ucampus.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface userRegisterMapper {

    // 插入到user表
    @Insert("INSERT INTO user (id, userPhone, userPassword) VALUES (#{id}, #{userPhone}, #{userpassword})")
    void insertUser(long id, String userPhone, String userpassword);

    // 插入到userinfo表
    @Insert("INSERT INTO userinfo (id, userPhone) VALUES (#{id}, #{userPhone})")
    void insertUserInfo(long id, String userPhone);

    // 检查数据库中是否存在指定的 userId
    @Select("SELECT COUNT(1) FROM user WHERE id = #{id}")
    boolean userIdExists(long id);
}
